/**
 * edurender
 * SoftwareQuake3Model.h
 * (c) 2009 J. Brad Byrd
 */

#ifndef ER_SOFTWAREQUAKE3MODEL_H
#define ER_SOFTWAREQUAKE3MODEL_H

#include "Types.h"
#include "DXUT.h"

#include <vector>

namespace er
{
	class Quake3ModelReader;
	class SoftwareRenderer;
	class RenderState;
	
	class SoftwareQuake3Model
	{
	public:
		static SoftwareQuake3Model *Create(Quake3ModelReader *reader, SoftwareRenderer *renderer);
		static void Destroy(SoftwareQuake3Model *model);
		
	public:
		void Draw(const RenderState &renderState);
	
	private:
		struct Vertex
		{
			D3DXVECTOR3 position;
		};

	private:
		SoftwareQuake3Model(SoftwareRenderer *renderer);
		~SoftwareQuake3Model();
		bool Initialize(Quake3ModelReader *reader);
	
	private:
		SoftwareRenderer *m_renderer;
		std::vector<Vertex> m_vertices;
		std::vector<UInt16> m_indices;
		
	private:
		SoftwareQuake3Model(const SoftwareQuake3Model &);
		SoftwareQuake3Model &operator=(const SoftwareQuake3Model &);
	};
}

#endif // ER_SOFTWAREQUAKE3MODEL_H
